.buttons
  = link_to "New Post", new_blog_post_path(@blog), :class => 'add'

- @posts = @blog.posts_for_admin.paginate(:page => params[:p])

= table_for Blog::Post, :id => "blog-posts" do |table|
  - table.rows(@posts) do |row, post|
    - row.resource = post
    
    = row.column(:title, :link => true)
    = row.column(:author) { post.author_name || 'None' }
    = row.column(:published_at, :class => "published-at") do
      - if post.published?
        =l post.published_at, :format => :blog_date
        %small=l post.published_at, :format => :blog_time
      - else
        %span.draft Draft
  
    = row.controls do |c|
      = c.delete
  
  - table.empty do
    No blog posts have been created.
    = link_to "Create a new post.", new_blog_post_path(@blog)

= will_paginate @posts
